from gpiozero import LED
from time import sleep

makerobo_RelayPin = LED(17)



def makerobo_setup(): # 初始化
    makerobo_RelayPin.off()

def makerobo_loop(): #循环函数
    while True:
        makerobo_RelayPin.on()
        sleep(2)
        makerobo_RelayPin.off()
        sleep(2)

def makerobo_destroy():
    makerobo_RelayPin.close() #释放资源

if __name__ == "__main__":
    makerobo_setup()
    try:
       makerobo_loop()
    except KeyboardInterrupt: #按下Ctrl+C时
        makerobo_destroy()

